package org.devocean.groupbuying.web.frontend.displaybeans;

import java.util.ArrayList;
import java.util.List;

import org.devocean.groupbuying.domain.Article;
import org.devocean.groupbuying.domain.Plan;
import org.devocean.groupbuying.domain.Promotion;

public class ProductPlanBean {
	
	
	private Plan plan;
	
	private Article planArticle;
	
	private List<Promotion> promotions;
	
	
	public ProductPlanBean(Plan plan) {
		this.plan = plan;
		promotions = new ArrayList<Promotion>();
	}


	public Plan getPlan() {
		
		return plan;
	}


	public void setPlan(Plan plan) {
		this.plan = plan;
	}


	public List<Promotion> getPromotions() {
		
		promotions.addAll(plan.getPromotions());
		return promotions;
	}


	public void setPromotions(List<Promotion> promotions) {
		this.promotions = promotions;
	}


	public Article getPlanArticle() {
		planArticle = this.plan.getArticlesLocalization().getArticles().iterator().next();
		return planArticle;
	}


	public void setPlanArticle(Article planArticle) {
		this.planArticle = planArticle;
	}

}
